package com.inspectortime.domain.type;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class Name {

	private String first;

	private String middle;

	private String last;

	@Column(length = 50)
	public String getFirst() {
		return first;
	}

	public void setFirst(String _first) {
		this.first = _first;
	}

	@Column(length = 50)
	public String getMiddle() {
		return middle;
	}

	public void setMiddle(String _middle) {
		this.middle = _middle;
	}

	@Column(length = 50)
	public String getLast() {
		return last;
	}

	public void setLast(String _last) {
		this.last = _last;
	}

	public String toString() {
		return asFullName();
	}
	
	public String asFullName() {
		String middleStr = middle == null ? "" : middle + " ";
		return first + " " + middleStr + last;
	}
}
